﻿using System;
using TradeMeSDK;

namespace TradeMo
{
    public class QuestionViewModel : BaseViewModel
    {
        public Question Question { get; set; }

        public string Nickname
        {
            get
            {
                if (Question.AskingMember == null) return "";
                return string.Format("{0} ({1})", 
                                     Question.AskingMember.Nickname, Question.AskingMember.UniquePositive);
            }
        }

        public string QuestionDate
        {
            get
            {
                return Question.CommentDate.ToString("d MMM, hh:mm tt");
            }
        }

        public string AnswerDate
        {
            get
            {
                if (Question.AnswerDate.Year < 1980) return null;
                return Question.AnswerDate.ToString("d MMM, hh:mm tt");
            }
        }


    }
}